    define("pages/jls_Xjjs/form", [
            '../../pages/jls_Xjjs/XjjsForm.html.js',
        ],
        function(require){
            var _show=function(_ryjbxx,_xjjs,findXjjs){
                var tmp= require("../../pages/jls_Xjjs/XjjsForm.html");
                var htmlcompile = template.compile(tmp);
                var html = htmlcompile(
                    {
                        title:"财务接收",
                        jbxx:_ryjbxx,
                        data:_xjjs,
                    });
                $("#gjcx").dialog('destroy')
                $("#dlgXjjs").dialog('destroy')
                $("#xjjsForm").html(html);
                $.parser.parse($("#xjjsForm").parent());
                var jjzjlx=[{id: '1',value: '身份证'},
                    {id:'2', value: '暂住证'},
                    {id:'3', value: '户口簿'},
                    {id:'4', value: '军官证'},
                    {id:'5', value: '警官证'},
                    {id:'6', value: '士兵证'},
                    {id:'7', value: '护照'},
                    {id:'8', value: '无证件'},
                    {id:'9', value: '其他证件'}];
                $('#jjzjlx').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: jjzjlx
                });
                var jjybjjrgx=[{id: '1',value: '配偶'},
                    {id:'2', value: '夫'},
                    {id:'3', value: '妻'},
                    {id:'4', value: '儿子'},
                    {id:'5', value: '独生子'},
                    {id:'6', value: '女婿'},
                    {id:'7', value: '女儿'},
                    {id:'8', value: '独生女'},
                    {id:'9', value: '儿媳'},
                    {id:'11', value: '孙(外孙)子女'},
                    {id:'12', value: '孙子'},
                    {id:'13', value: '孙女'},
                    {id:'14', value: '外孙子'},
                    {id:'15', value: '外孙女'},
                    {id:'16', value: '父母'},
                    {id:'17', value: '父亲'},
                    {id:'18', value: '母亲'},
                    {id:'19', value: '公公'},
                    {id:'20', value: '婆婆'},
                    {id:'21', value: '岳父'},
                    {id:'22', value: '岳母'},
                    {id:'23', value: '祖(外祖)父母'},
                    {id:'24', value: '兄弟姐妹'},
                    {id:'25', value: '兄'},
                    {id:'26', value: '嫂'},
                    {id:'27', value: '弟'},
                    {id:'28', value: '弟妹'},
                    {id:'29', value: '姐姐'},
                    {id:'30', value: '妹妹'},
                    {id:'31', value: '妹夫'},
                    {id:'32', value: '其他亲属'},
                    {id:'33', value: '非亲属关系'},
                    {id:'34', value: '同案人'},
                    {id:'35', value: '朋友'},
                    {id:'36', value: '同伙'},
                    {id:'37', value: '同监'},
                    {id:'38', value: '结拜兄弟(姐妹)'},
                    {id:'39', value: '赌友'},
                    {id:'40', value: '同事'},
                    {id:'41', value: '同乡'},
                    {id:'42', value: '同学'},
                    {id:'43', value: '校友'},
                    {id:'44', value: '战友'},
                    {id:'45', value: '学友'},
                    {id:'46', value: '网友'},
                    {id:'47', value: '师生'},
                    {id:'48', value: '师徒'},
                    {id:'49', value: '教友'},
                    {id:'50', value: '邻居'},
                    {id:'51', value: '主顾'},
                    {id:'52', value: '合伙人'},
                    {id:'53', value: '客户'},
                    {id:'54', value: '恋人'},
                    {id:'55', value: '情人'},
                    {id:'56', value: '同性恋'},
                    {id:'57', value: '前夫妻'},
                    {id:'58', value: '前夫'},
                    {id:'59', value: '前妻'},
                    {id:'60', value: '其他非亲属'}];
                $('#jjybjjrgx').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: jjybjjrgx
                });
                var wp1=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp1').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp1
                });
                var wp2=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp2').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp2
                });
                var wp3=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp3').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp3
                });
                var wp4=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp4').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp4
                });
                var wp5=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp5').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp5
                });
                var wp6=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp6').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp6
                });
                var wp7=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp7').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp7
                });
                var wp8=[{id: '1',value: '毯子'},
                    {id:'2', value: '卫生衫'},
                    {id:'3', value: '卫生裤'},
                    {id:'4', value: '绒线衫'},
                    {id:'5', value: '绒线裤'},
                    {id:'6', value: '绒线背心'},
                    {id:'7', value: '棉毛衫'},
                    {id:'8', value: '棉毛裤'},
                    {id:'9', value: '腈纶衫'},
                    {id:'10', value: '腈纶裤'},
                    {id:'11', value: '线衫'},
                    {id:'12', value: '线裤'},
                    {id:'13', value: '羊毛衫'},
                    {id:'14', value: '羊毛裤'},
                    {id:'15', value: '羊毛背心'},
                    {id:'16', value: '上装'},
                    {id:'17', value: '长裤'},
                    {id:'18', value: '长袖衬衫'},
                    {id:'19', value: '短袖衬衫'},
                    {id:'20', value: '短裤'},
                    {id:'21', value: '衬裤'},
                    {id:'22', value: '汗衫'},
                    {id:'23', value: '汗背心'},
                    {id:'24', value: '袜'},
                    {id:'25', value: '其他'}];
                $('#wp8').combobox({
                    valueField: 'id',
                    textField: 'value',
                    panelHeight: 'auto',
                    editable: false,
                    data: wp8
                });
                $('#dlgXjjs').window('open');
                bindAction(findXjjs);
            }

            var submitXjjs=function(findXjjs){
                var row = $('#jbxxId').datagrid('getSelected');
                var validate=$("#dlgXjjs").form('validate');
                if (validate) {
                    var data =$("#fm").serialize()+"&jsbh="+row.jsbh+"&rybh="+row.rybh;
                    submitLoad();
                    $.ajax({
                        type : "POST",  //提交方式
                        url : "/jls_xjjs/xjjsAdd",//路径
                        data : data,//数据，这里使用的是Json格式进行传输
                        success : function(result) {
                            if (result.success) {
                                if($.isFunction(findXjjs)){
                                    findXjjs();
                                }
                                $.messager.alert("确定","保存成功","info");
                                javascript:$('#dlgXjjs').dialog('close');
                                removeLoad();
                            }else{
                                $.messager.alert("确定","保存失败","info");
                                removeLoad();
                            }
                        },
                        error:function(){
                            removeLoad();

                        }
                    });
                }else{
                    $.messager.alert("提示", '必填项不能为空！');
                }
            };
            var updateXjjs=function(findXjjs){
                var row = $('#jbxxId').datagrid('getSelected');
                var validate=$("#dlgXjjs").form('validate');
                if (validate) {
                    var data =$("#fm").serialize();
                    submitLoad();
                    $.ajax({
                        type : "POST",  //提交方式
                        url : "/jls_xjjs/xjjsUpdate",//路径
                        data : data,//数据，这里使用的是Json格式进行传输
                        success : function(result) {
                            if (result.success) {
                                $.messager.alert("确定","修改成功","info");
                                javascript:$('#dlgXjjs').dialog('close');
                                removeLoad();
                                if($.isFunction(findXjjs)){
                                    findXjjs();
                                }
                            }else{
                                $.messager.alert("确定",result.msg,"info");
                                removeLoad();

                            }
                        },
                        error:function(){
                            removeLoad();

                        }
                    });
                }else{
                    $.messager.alert("提示", '必填项不能为空！');
                }
            };

            var bindAction=function(findXjjs){
                $("#xjjsSave").on("click",function(){
                    var xjjsId = $("#xjjsId").val();
                    if(xjjsId=="" || xjjsId==null){
                        submitXjjs(findXjjs);
                    }else{
                        updateXjjs(findXjjs);
                    }
                });
                $("#xjjsCanel").on("click",function(){
                    $("#dlgXjjs").dialog("close");
                });
            }
            return{
                show:_show
            }
        });
